<?php

/* * 
 * 资讯
 */
namespace Common\Model;
use Think\Model;
class BookingModel extends BaseModel {

    public function queryForList($page=null, $map=null) {
        $list = $this->alias("b")
            ->join("left join __CATEGORY__ c on c.category_id = b.category_id")
            ->join("left join __SHOP__ s on s.shop_id = b.shop_id")
            ->join("left join __CUSTOMER__ cus on cus.customer_id = b.customer_id")
            ->join("left join __PAY__ pay on pay.pay_id = b.pay_id")
            ->where(getWhereSqlByMap($map))
            ->order("b.create_time desc")
            ->limit($page->firstRow . ',' . $page->listRows)
            ->field("b.*,c.category_name,s.shop_name,pay.money,cus.nickname,cus.doctor_name,cus.hospital_name")
            ->select();

        return $list;

    }

}

